package com.example.demo.service.imply;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.annotation.AutoFill;
import com.example.demo.enumeration.OperationType;
import com.example.demo.mapper.testMapper;
import com.example.demo.pojo.PublicFields;
import com.example.demo.pojo.dto.ComponentDTO;
import com.example.demo.service.ITestService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.example.demo.pojo.entity.Component;

@Service
@RequiredArgsConstructor
public class ITestServiceImply extends ServiceImpl<testMapper, Component> implements ITestService {

    private final testMapper testMapper1;

    @Override
    @AutoFill(OperationType.INSERT)
    public Component test(ComponentDTO componentDTO, PublicFields publicFields) {
        Component device = new Component();
        BeanUtils.copyProperties(componentDTO, device);
        BeanUtils.copyProperties(publicFields, device);
        System.out.println(device);
        baseMapper.insert(device);
        return  null;
    }
}
